// # 渲染ListView的每一项数据

import React from 'react';
import { ListStyled } from '../ListViewStyle'
import { Link } from 'react-router-dom'

const Item = ({ data }, sectionID, rowID) => {
  // console.log(data);
  return (
    <ListStyled key={rowID}>
      <Link to={"/detail/home/" + data.item_id }>
        <div>
          <span>
            <img src={data.img ? data.img : data.img_attr[0]} />
          </span>
        </div>
        <div className="test">
          <h1>{data.title}</h1>
          {
            data.intro
              ?
              <p>
                <img
                  src="//sh1.hoopchina.com.cn/images/trademobile/quote_left.png"
                />
                {data.intro}
                <img
                  src="//sh1.hoopchina.com.cn/images/trademobile/quote_right.png"
                />
              </p>
              :
              ''
          }
          <div>
            {data.author_name ? data.author_name : data.merchant} &nbsp;
            <span>{data.price ? '￥' + data.price : ''}</span>
          </div>
        </div>
      </Link>
    </ListStyled>
  );
}

export default Item;
